require File.dirname(__FILE__)+'/../lib/std_lib.rb'
require File.dirname(__FILE__)+'/../lib/reporting.rb'
require File.dirname(__FILE__)+'/../lib//testdata/testdata.rb'
require 'watir'
require 'watir/testcase'
require File.dirname(__FILE__)+'/../lib/elements/Homepage/element_Homepage.rb'
#How to definite the variable for part of ie
#=begin
class Login_Test < Watir::TestCase
    def test_setup
        #OCRM_STD_LIB.login($product,$username,$password)
        filename  = File.basename(__FILE__).gsub(/\.rb/, "")
        begin
            $log=Reporting.new(File.dirname(__FILE__)+'/../doc/report/'"",filename)

        rescue
            puts $!
            puts $@
            $log.close unless $log.nil?
        end

    end

    def test_result
=begin
        $log.test_notes("Test OracleCRM")
        $log.test_notes("Start To Test ")
        for i in 1..2000
            OCRM_STD_LIB.login($product,$username,$password)
            t=Time.now.strftime("%m/%d %H:%M:%S")
            $log.test_notes(t)
            $log.test_notes("Round"+" "+i.to_s+t)
            $log.test_validate($ie.title.eql?("Home - Oracle CRM On Demand"), "Login Success or not")

            #Element::Header_Link.sign_out.click
            sleep 60

            $ie.close
=end
        EBS_STD_LIB.login($test,$username,$password)
        #        EBS_STD_LIB.login($product,$username,$password)
        $ie = Watir::IE.attach(:title,/Oracle/)
        Element::Navigator.workflow_user_link.click
           
    end

        
end


class NewLogin < Watir::TestCase

    def test_setup

    end

    def test_tear_down
        $log.close unless $log.nil?
    end
end
#=end
#$ie = Watir::IE.attach(:title,"Home - Oracle CRM On Demand")
#Element::Quick_Search.quick_search_div.selection_box.set("Leads")
